package ${packageUrl}.service.impl;
import ${packageUrl}.dto.${entity}Dto;
import ${packageUrl}.service.${entity}Service;
import ${packageUrl}.mapper.${entity}Mapper;
import ${packageUrl}.model.${entity};
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import javax.transaction.Transactional;
/**
 * 
 * @ClassName:  ${entity}ServiceImpl   
 * @Description:${title}service层实现类
 * @author: ${author}
 * @date:   ${date}
 */
@Service
@Slf4j
@Transactional 
public class ${entity}ServiceImpl implements ${entity}Service{

	@Autowired
	private ${entity}Mapper mapper;
	
	@Override
	public ${entity} queryById(String id) {
		
		return mapper.queryById(id);
	}


	@Override
	public void insert(${entity} ${entityLower}) {
	
		mapper.insert(dataSource);
	}


	@Override
	public void update(${entity} ${entityLower}) {
		
		mapper.update(${entityLower});
		
	}


	@Override
	public void delete(String id) {
	
		mapper.delete(id);
	}


	@Override
	public List<${entity}> list(${entity}Dto dto) {
	
		return mapper.list(dto);
	}


	@Override
	public void loadPage(${entity}Dto dto) {
		
		int totalRecords = mapper.count(dto);
		dto.setTotalRecords(totalRecords);
		dto.setDataList(this.list(dto));
    }
	
}

